#ifndef __CINETIC__SCENE_H__
#define __CINETIC__SCENE_H__
#pragma once

#include "ControllerManager.h"
#include "OgreString.h"

namespace Cinetic
{
    class SceneObserver
    {
    public:
        virtual void on_game_object_added( std::weak_ptr<GameObject> go ) = 0;
        virtual void on_game_object_removed( std::weak_ptr<GameObject> go ) = 0;
        virtual void on_component_added( std::weak_ptr<GameObject> go, std::weak_ptr<Component> c) = 0;
        virtual void on_component_removed( std::weak_ptr<GameObject> go, std::weak_ptr<Component> c) = 0;
    };
    
	class Scene
	{

	public:
		std::weak_ptr<GameObject> add_static_model( Ogre::String mesh_name );
		std::weak_ptr<GameObject> add_actor( Ogre::String mesh_name );

        void attach( SceneObserver* observer );
        void detach( SceneObserver* observer );

    private:
        void on_game_object_component_added( std::weak_ptr<GameObject> go, std::weak_ptr<Component> comp );
        void on_game_object_component_removed( std::weak_ptr<GameObject> go, std::weak_ptr<Component> comp );

	private:
		std::vector<std::shared_ptr<GameObject>>	m_game_objects;
		std::vector<SceneObserver*>                 m_observers;
	};
}

#endif